package com.kantboot.business.gc.admin.controller;

import com.kantboot.business.gc.domain.dto.BusGcGameSearchDTO;
import com.kantboot.business.gc.domain.vo.BusGcGameCollectAndClickVO;
import com.kantboot.business.gc.domain.vo.BusGcGameVO;
import com.kantboot.business.gc.service.IBusGcGameService;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.controller.BaseAdminController;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 游戏类型的管理端控制器
 */
@RestController
@RequestMapping("/business/gc/admin/game")
public class BusGcGameControllerOfAdmin
        extends BaseAdminController<BusGcGameVO, Long> {

    @Resource
    private IBusGcGameService service;

    @RequestMapping("/getBodyData")
    public RestResult<PageResult> getBodyData(@RequestBody PageParam<BusGcGameSearchDTO> pageParam) {
        return RestResult.success(service.getBodyData(pageParam), "getSuccess", "获取成功");
    }

    @RequestMapping("/save")
    public RestResult<BusGcGameVO> save(@RequestBody BusGcGameVO vo) {
        return RestResult.success(service.save(vo), "saveSuccess", "保存成功");
    }

    //获取游戏收藏用户和游戏点击数数据
    @RequestMapping("/getGameCollectAndClick")
    public RestResult<BusGcGameCollectAndClickVO> getGameCollectAndClick(@RequestParam("gameId") Long gameId) {
        return RestResult.success(service.getGameCollectAndClick(gameId), "getSuccess", "获取成功");
    }


}
